<template>
  <div class="home">
    <header class="page-header">
      <h1>欢迎来到商城</h1>
      <p class="tagline">一站式购物平台，尽享品质生活</p>
    </header>
    <main class="main-content">
      <section class="banner-section">
        <img src="@/assets/sc1.png" alt="商城首页轮播图" class="banner-img">
      </section>
      <section class="promo-section">
        <div class="promo-item">
          <img src="@/assets/sc4.png" alt="优惠活动1" class="promo-img">
          <h3 class="promo-title">不容错过！</h3>
          <p class="promo-description">精选商品，赶快选购吧！</p>
          <router-link to="/promotions" class="promo-link"></router-link>
        </div>
        <div class="promo-item">
          <img src="@/assets/sc3.png" alt="优惠活动2" class="promo-img">
          <h3 class="promo-title">超值福利！</h3>
          <p class="promo-description">买到就是赚到！</p>
          <router-link to="/promotions" class="promo-link"></router-link>
        </div>
        <div class="promo-item">
          <img src="@/assets/sc2.png" alt="优惠活动3" class="promo-img">
          <h3 class="promo-title">好礼相送！</h3>
          <p class="promo-description">购买即送优惠券，购物更划算！</p>
          <router-link to="/promotions" class="promo-link"></router-link>
        </div>
      </section>
      <section class="category-section">
        <h2 class="category-title">热门商品</h2>
        <div class="category-grid">
          <div class="category-item">
            <img src="@/assets/img_8.png" alt="商品分类1" class="category-img">
            <p class="category-text">U盘</p>
          </div>
          <div class="category-item">
            <img src="@/assets/img_9.png" alt="商品分类2" class="category-img">
            <p class="category-text">游戏手柄</p>
          </div>
          <div class="category-item">
            <img src="@/assets/img_11.png" alt="商品分类3" class="category-img">
            <p class="category-text">数码相机</p>
          </div>
          <div class="category-item">
            <img src="@/assets/img_10.png" alt="商品分类4" class="category-img">
            <p class="category-text">蓝牙耳机</p>
          </div>
        </div>
      </section>
      <section class="cta-section">
        <router-link to="/products" class="cta-button">
          <span class="button-text">前往商品列表</span>
          <span class="button-icon">👉</span>
        </router-link>
      </section>
    </main>
    <footer class="page-footer">
      <p class="footer-text">
        &copy; 2024 商城版权所有. 保留所有权利. <br>
        客服热线：123456789 <br>
        电子邮箱：service@example.com
      </p>
    </footer>
  </div>
</template>

<script>
export default {
  name: 'Home'
};
</script>

<style scoped>
.home {
  font-family: Arial, sans-serif;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
  padding: 50px;
}

.page-header {
  margin-bottom: 30px;
}

.page-header h1 {
  font-size: 36px;
  margin: 0;
  color: #333;
}

.tagline {
  font-size: 18px;
  color: #666;
  margin-top: 10px;
}

.main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.banner-section {
  width: 100%;
  margin-bottom: 30px;
}

.banner-img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.promo-section {
  display: flex;
  justify-content: space-around;
  margin-bottom: 40px;
  width: 100%;
}

.promo-item {
  background-color: #f9f9f9;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 300px;
  padding: 20px;
  text-align: left;
  transition: transform 0.3s ease;
}

.promo-item:hover {
  transform: translateY(-5px);
}

.promo-img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 10px;
}

.promo-title {
  font-size: 20px;
  margin-bottom: 5px;
  color: #333;
}

.promo-description {
  font-size: 14px;
  color: #777;
  margin-bottom: 15px;
}

.promo-link {
  display: inline-block;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.promo-link:hover {
  background-color: #0056b3;
}

.category-section {
  width: 100%;
  margin-bottom: 40px;
}

.category-title {
  font-size: 24px;
  margin-bottom: 20px;
  color: #333;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 30px;
}

.category-item {
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 20px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.category-item:hover {
  transform: scale(1.1);
}

.category-img {
  width: 100%;
  height: auto;
  margin-bottom: 10px;
}

.category-text {
  font-size: 16px;
  color: #555;
}

.cta-section {
  margin-bottom: 30px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  padding: 12px 25px;
  border-radius: 5px;
  font-size: 18px;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.cta-button:hover {
  background-color: #0056b3;
  transform: translateY(-3px);
}

.button-text {
  margin-right: 10px;
}

.button-icon {
  font-size: 20px;
}

.page-footer {
  font-size: 14px;
  color: #888;
}
</style>